import axios from 'axios'

const request = axios.create({
  baseURL: 'https://apipc-xiaotuxian-front.itheima.net',
  // baseURL: process.env.VUE_APP_URL,
  timeout: 5000
})

// 请求拦截器
request.interceptors.request.use(
  config => {
    return config
  },
  error => {
    return Promise.reject(error)
  }
)

// 响应拦截器
request.interceptors.response.use(
  res => {
    return res.data
  },
  error => {
    return Promise.reject(error)
  }
)
export default request
